import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from './store';
import publicFunction from '@/utils/public';

import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/antd.less'; // or 'ant-design-vue/dist/antd.less'
import "@styles/common.css";
import 'iview/dist/styles/iview.css';

import bootstrap from './core/bootstrap';
import './core/use';
import './permission'; // permission control
import './utils/filter'; // global filter
import echarts from 'echarts'   //报表图
import BaiduMap from 'vue-baidu-map'    //百度地图

Vue.prototype.$echarts = echarts //将echarts存到Vue原型中

Vue.config.productionTip = false;

Vue.use(BaiduMap, {ak: 'HFwNbBALqsECpA0a9vZUhpxjFhQxBPIh'})
Vue.use(Antd);
Vue.use(publicFunction);

// 根据key删除数组对应值       执行的时候，直接对应的array对象，array.remove('对应的值');
Array.prototype.indexOf = function(val) {
  for (var i = 0; i < this.length; i++) {
    if (this[i] == val) return i;
  }
  return -1;
};
Array.prototype.remove = function(val) {
  var index = this.indexOf(val);
  if (index > -1) {
    this.splice(index, 1);
  }
};

new Vue({
  router,
  store,
  created() {
    bootstrap();
  },
  render: h => h(App),
}).$mount('#app');
